package com.abe.abetest;

import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;

import com.abe.abetest.alarm.AlarmOpenActivity;
import com.abe.abetest.album.AlbumActivity;
import com.abe.libbase.base.BaseRecyclerActivity;
import com.abe.abetest.file.FilePickerActivity;
import com.abe.abetest.finger.FingerPrintActivity;
import com.abe.abetest.fragment.abeTestFragment;
import com.abe.abetest.widget.BottomView;
import com.abe.abetest.widget.YaoView;

public class AbeTestActivity extends BaseRecyclerActivity {
    @Override
    public void init() {
        btnNames = new String[]{
                "闹钟（单次与循环）", "多媒体", "文件选择",
                "指纹识别", "自定义View（监听返回键）",
                "PopWindow", "Fragment"};
        super.init();
    }

    @Override
    public void onItemClick(View view, RecyclerView.ViewHolder holder, int position) {
        switch (position) {
            case 0:
                gotoActivity(AlarmOpenActivity.class);
                break;
            case 1:
                gotoActivity(AlbumActivity.class);
                break;
            case 2:
                gotoActivity(FilePickerActivity.class);
                break;
            case 3:
                gotoActivity(FingerPrintActivity.class);
                break;
            case 4: {
                YaoView yaoView = new YaoView(this);
                yaoView.show();
            }
            break;
            case 5: {
                View contentView = LayoutInflater.from(this).inflate(R.layout.item_view_pop, null);
                BottomView bottomView = new BottomView(this, contentView);
                bottomView.show();
            }
            break;
            case 6: {
                Intent intent = new Intent(this, AbeFragmentActivity.class);
                intent.putExtra("fragmentName", abeTestFragment.class.getName());
                startActivity(intent);
            }
            break;
        }
    }

    @Override
    public boolean onItemLongClick(View view, RecyclerView.ViewHolder holder, int position) {
        return false;
    }
}